﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:Controls="clr-namespace:Sinacor.Infra.UI.Controls.SmartClient;assembly=Sinacor.Infra.UI.Controls">

    <LinearGradientBrush x:Key="BrushZoomBackgroundHover" StartPoint="0.507143,0.0897435" EndPoint="0.507143,0.948718">
        <GradientStop Color="#FF306ED3" Offset="0"/>
        <GradientStop Color="#FF245EB4" Offset="0.177072"/>
        <GradientStop Color="#FF184F95" Offset="0.497717"/>
        <GradientStop Color="#FF13437D" Offset="0.509311"/>
        <GradientStop Color="#FE0E3865" Offset="0.515982"/>
        <GradientStop Color="#FF026CB8" Offset="1"/>
    </LinearGradientBrush>

    <!--BEGIN ZOOM-->
    <Style x:Key="ControlZoomButton" TargetType="{x:Type Controls:SinacorButton}">
        <Setter Property="CausesValidation" Value="False"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Controls:SinacorButton}">
                    <Border Height="18" Width="37" x:Name="Border" HorizontalAlignment="Center">
                        <StackPanel VerticalAlignment="Center" Orientation="Horizontal">
                            <Grid VerticalAlignment="Center" Width="19">
                                <ContentControl Content="{TemplateBinding Content}" HorizontalContentAlignment="Center" Style="{DynamicResource ControlFont}" Foreground="#FFFFFFFF"/>
                            </Grid>
                            <Label Padding="0" Content="%" Style="{DynamicResource ControlFont}" Foreground="#FF848484" Margin="3,0,0,0"/>
                        </StackPanel>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="Background" Value="{DynamicResource BrushZoomBackgroundHover}" TargetName="Border"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
    <Style TargetType="{x:Type Controls:SinacorZoom}">
        <Setter Property="Height" Value="139"/>
        <Setter Property="Width" Value="63"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Controls:SinacorZoom}">
                    <Border x:Name="PART_Border" Background="#FF000000" BorderBrush="#FFCCCCCC" BorderThickness="0" CornerRadius="9">
                        <StackPanel Orientation="Vertical">
                            <StackPanel Orientation="Horizontal">
                                <StackPanel x:Name="PART_StackPanel" Orientation="Vertical" HorizontalAlignment="Left" Margin="7,5,5,3">
                                    <Controls:SinacorButton Content="200" HorizontalContentAlignment="Center" Command="Controls:SinacorZoomCommands.Percent200" CommandParameter="200" Style="{StaticResource ControlZoomButton}"/>
                                    <Controls:SinacorButton Content="150" Command="Controls:SinacorZoomCommands.Percent150" CommandParameter="150" Style="{StaticResource ControlZoomButton}"/>
                                    <Controls:SinacorButton Content="100" Command="Controls:SinacorZoomCommands.Percent100" CommandParameter="100" Style="{StaticResource ControlZoomButton}"/>
                                    <Controls:SinacorButton Content="75" Command="Controls:SinacorZoomCommands.Percent75" CommandParameter="75" Style="{StaticResource ControlZoomButton}"/>
                                    <Controls:SinacorButton Content="50" HorizontalContentAlignment="Center" Command="Controls:SinacorZoomCommands.Percent50" CommandParameter="50" Style="{StaticResource ControlZoomButton}"/>
                                </StackPanel>
                                <Controls:SinacorVerticalSlider Height="{Binding ActualHeight, ElementName=PART_StackPanel}" Width="15" Minimum="30" Maximum="300" Interval="5" x:Name="PART_Slider" HorizontalAlignment="Left" VerticalAlignment="Top" Value="{Binding CurrentZoom, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Margin="-3,2,-3,-6" Style="{DynamicResource ControlZoomSlider}"/>
                            </StackPanel>
                            <Grid Margin="0,0,0,0">
                                <Controls:SinacorInt16TextBox TextAlignment="Right" Width="Auto" Margin="3,0" Padding="0,0.5,26.5,0" Height="16" Integers="3" MinValue="30" MaxValue="300" Value="{Binding CurrentZoom, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" x:Name="PART_Text"/>
                                <Label Content="%" Foreground="#FF333333" Style="{DynamicResource ControlFont}" Width="10" Margin="0,0,-7.5,0" Padding="0,1.5,0,0" x:Name="PART_Percent"/>
                            </Grid>
                            <Controls:SinacorButton x:Name="PART_RestoreButton" HorizontalContentAlignment="Center" Width="Auto" Margin="2.5,3" HorizontalAlignment="Stretch" Content="Restaurar" Command="Controls:SinacorZoomCommands.Restore" FontSize="10"/>
                        </StackPanel>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="TextLength" Value="1" SourceName="PART_Text">
                            <Setter Property="Padding" Value="0,0.5,26.5,0" TargetName="PART_Text"/>
                            <Setter Property="Margin" Value="0,0,-7.5,0" TargetName="PART_Percent"/>
                        </Trigger>
                        <Trigger Property="TextLength" Value="2" SourceName="PART_Text">
                            <Setter Property="Padding" Value="0,0.5,24.75,0" TargetName="PART_Text"/>
                            <Setter Property="Margin" Value="0,0,-11.5,0" TargetName="PART_Percent"/>
                        </Trigger>
                        <Trigger Property="TextLength" Value="3" SourceName="PART_Text">
                            <Setter Property="Padding" Value="-14,0.5,21.75,0" TargetName="PART_Text"/>
                            <Setter Property="Margin" Value="0,0,-17.75,0" TargetName="PART_Percent"/>
                        </Trigger>
                        <Trigger Property="ShowRestore" Value="False">
                            <Setter Property="Height" Value="120"/>
                            <Setter Property="Visibility" Value="Collapsed" TargetName="PART_RestoreButton"/>
                            <Setter Property="BorderThickness" Value="1,1,1,0" TargetName="PART_Border"/>
                            <Setter Property="CornerRadius" Value="9,9,0,0" TargetName="PART_Border"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <!--END ZOOM-->
</ResourceDictionary>